﻿using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.SettingManagement;

namespace Himp.Platform
{
    public static class LocalSettingManagerExtensions
    {
        public const string ProviderName = "L";

        public static Task<string> GetOrNullForLocalAsync(this ISettingManager settingManager, [NotNull] string name, string localId, bool fallback = true)
        {
            return settingManager.GetOrNullAsync(name, ProviderName, localId, fallback);
        }

        public static Task SetForLocalAsync(this ISettingManager settingManager, [NotNull] string localId, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false)
        {
            return settingManager.SetAsync(name, value, ProviderName, localId, forceToSet);
        }
    }
}
